package sogo.myi.micro.configclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 1.手动refresh刷新配置，
 * 2.通过配置git webhook 设置触发时间自动refresh配置(码云：管理--> webhook)
 * @author yulu206836
 *
 */
@SpringBootApplication
@RestController
@RefreshScope
public class ConfigClientApplication {

	@Value("${hello}")
	private String hello;

	public static void main(String[] args) {
		SpringApplication.run(ConfigClientApplication.class, args);
	}

	@RequestMapping("/hello")
	public String hello() {
		return hello;
	}
}
